package com.source.labelAndBarcode.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.source.labelAndBarcode.entity.LabelingRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.source.labelAndBarcode.vo.*;

import java.math.BigInteger;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Joey
 * @since 2021-02-23
 */
public interface LabelingRecordService extends IService<LabelingRecord> {

    /**
     * 查询某档口当周使用标签数
     * @param id 档口id
     * @return  count
     */
    int weeklyRecord(Integer id);

    /**
     * 查询某档口当月使用标签数
     * @param id 档口id
     * @return  count
     */
    int monthlyRecord(Integer id);

    /**
     * 查询某档口当天某禽类使用标签数
     */
    List<Map<String, BigInteger>> dailyRecordByPoultry(Integer id);

    List<Map<String, BigInteger>> weeklyRecordByPoultry(Integer id);

    List<Map<String, BigInteger>> monthlyRecordByPoultry(Integer id);

    List<Map<Object, Object>> dailyRecordByPoultryAndToMark(Integer id);

    List<Map<Object, Object>> weeklyRecordByPoultryAndToMark(Integer id);

    List<Map<Object, Object>> monthlyRecordByPoultryAndToMark(Integer id);

    IPage<BarcodeCountVo> findByLikeNameAndTimeOnPagination(Page<BarcodeCountVo> page, String keyWord, Date startDate, Date endDate);

    IPage<BarcodeCountVo> findMonthly(Page<BarcodeCountVo> page);

    IPage<BarcodeCountVo> findAllOnPagination(Page<BarcodeCountVo> page);

    BarcodeCountVo findById(String id);

    TraceSrcVo getSrc(String barcodeNumber);

    IPage<DetailedRecordVo> findAllDROnPagination(Page<DetailedRecordVo> page);

    IPage<DetailedRecordVo> findAllDRByLikeNameOnPagination(Page<DetailedRecordVo> page, String keyWord);

    IPage<PoultryDateSaleVo> findByMultiKeyWord(String stallsName, String contacts, Date startDate, Date endDate, Page<PoultryDateSaleVo> page) throws ParseException;

    IPage<PoultrySaleVo> findCountsByTime(String stallsName, String contacts, Date startDate, Date endDate, Page<PoultrySaleVo> page) throws ParseException;

    DetailedRecordVo findDetailedRecordById(String id);

    IPage<PoultrySaleVo2> findCounts(String stallsName, String contacts, Date startDate, Date endDate, Page<PoultrySaleVo2> page) throws ParseException;

    Object findCountsGroupByDay(String stallsName, String contacts, Date startDate, Date endDate, Page<PoultryDateSaleVo> page) throws ParseException;
}
